﻿using Sys.Core.Models.Dto;
using Sys.Core.Models.Queries;
using Sys.Core.Models.VO;
using Sys.Core.Services;
using MiniFox.Components;
using MiniFox.Infrastructure;

namespace Sys.Core
{
    /// <summary>
    /// 应用及关联模块
    /// </summary>
    [AutoRegister, SpareComponent(typeof(AppService))]
    public interface IAppService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<ApplicationVo>> Query(PagedQueryObject<AppQuery> request);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        ApplicationVo Item(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="organization"></param>
        /// <returns></returns>
        ApplicationVo Create(ApplicationDto organization);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="organization"></param>
        /// <returns></returns>
        ApplicationVo Update(ApplicationDto organization);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        void Toggle(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        void Delete(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        string GetSecretKey(string appId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="appId"></param>
        /// <returns></returns>
        string NewSecretKey(string appId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="querys"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<ModuleVo>> QueryModules(PagedQueryObject<ModuleQuery> query);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        ModuleVo CreateModule(ModuleDto module);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        ModuleVo UpdateModule(ModuleDto module);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="modules"></param>
        void DeleteModule(params string[] modules);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleId"></param>
        /// <returns></returns>
        ModuleVo GetModule(string moduleId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleId"></param>
        /// <returns></returns>
        IEnumerable<ModuleActionVo> GetModuleActions(string moduleId);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleAction"></param>
        /// <returns></returns>
        ModuleActionVo CreateModuleAction(ModuleActionDto moduleAction);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="moduleAction"></param>
        /// <returns></returns>
        ModuleActionVo UpdateModuleAction(ModuleActionDto moduleAction);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="modules"></param>
        void DeleteModuleAction(params string[] moduleActions);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="actionId"></param>
        /// <returns></returns>
        ModuleActionVo GetModuleAction(string actionId);
    }
}
